package com.chencs.app.lianmeng.controller;

import com.alibaba.fastjson.JSON;
import com.chencs.app.lianmeng.service.LMShopSer;
import com.chencs.vo.biz.lianmeng.LmProduct;
import com.chencs.vo.biz.lianmeng.LmShop;
import com.chencs.vo.net.lmrequest.LmShopRequest;
import com.chencs.vo.net.lmrequest.LmSubjectListRequest;
import com.chencs.vo.net.lmrequest.LmSubjectRequest;
import com.chencs.vo.net.lmresponse.LmShopProResponse;
import com.chencs.vo.net.lmresponse.LmShopResponse;
import com.chencs.vo.net.lmresponse.LmSubjectListResponse;
import com.chencs.vo.net.lmresponse.LmSubjectResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/app/lmShop")
public class LMShopCtr {


    @Autowired
    private LMShopSer shopSer;



    /**
     * 推荐店铺列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/pushShop", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String pushShop(@RequestBody LmShopRequest request){
        LmShopResponse response = shopSer.pushShop(request);
        return JSON.toJSONString(response);
    }


    /**
     * 店铺列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/getShopList", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String getShopList(@RequestBody LmShopRequest request){
        LmShopResponse response = shopSer.getShopList(request);
        return JSON.toJSONString(response);
    }


    /**
     * 店铺商品详情
     * @param request
     * @return
     */
    @RequestMapping(value = "/getShopProBySid", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public String getShopProBySid(@RequestBody LmShopRequest request){
        LmShopProResponse response = shopSer.getShopProductBySid(request);
        return JSON.toJSONString(response);
    }
}
